import request from '@/utils/http'

// 添加收货地址
export const AddAddressService = ({ userName, phoneNumber, address }) => {
  return request.post('/user/address', { userName, phoneNumber, address })
}

// 删除收货地址
export const delAddressService = (addressId) => {
  console.log("删除地址的id",addressId);
  //return request.delete('/user/address', { params: { addressId } })
  return request({
    method:"DELETE",
    url:`/user/address?id=${addressId}`
  })
}

// 获取收货地址列表
export const GetAddressListService = () => {
  return request.get('/user/address/list')
}

//修改收货地址
export const UpdateAddressService = ({ id, userName, phoneNumber, address }) => {
  return request.put('/user/address', { id, userName, phoneNumber, address })
}